const { resolve } = require('path');
const themePath = resolve('src/assets/less/less-theme.less');
module.exports = {
  outputDir: 'view', // 打包输出文件目录(默认dist)
  publicPath: process.env.NODE_ENV === 'production' ? '/view/' : '/view/',
  pwa: {
    iconPaths: {
      favicon32: 'favicon.ico',
      favicon16: 'favicon.ico',
      appleTouchIcon: 'favicon.ico',
      maskIcon: 'favicon.ico',
      msTileImage: 'favicon.ico'
    }
  },
  css: {
    loaderOptions: {
      less: {
        modifyVars: {
          // 直接覆盖变量
          // 'text-color': '#111',
          // 或通过 less 文件覆盖（文件路径为绝对路径）
          hack: `true; @import "${themePath}";`,
        },
      },
    },
  },
  devServer: {
    open: true
  }
}